
package com.trydofor.id.doer.shell;

import com.trydofor.aloe.exception.Exceptions;

/**
 * the name-data-pair of Command's argument
 * 
 * @author : Shi Rongjiu (www.trydofor.com)
 */
public class ArgData {
    
    private final String name;
    private final String data;
    
    /**
     * the name-data-pair of argument
     * 
     * @param name the name
     * @param data the data
     * @throws NullPointerException if name is null
     */
    public ArgData(String name, String data) {
        Exceptions.checkNullPointer(name);
        
        this.name = name;
        this.data = data;
    }
    
    /**
     * @return the name
     */
    public String getName() {
        return name;
    }
    
    /**
     * @return the data
     */
    public String getData() {
        return data;
    }
    
    @Override
    public String toString() {
        return name + "=" + data;
    }
}
